<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<title>企业CRM管理平台V1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
	charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link  href="/crmp/Public/css/bootstrap.min.css" rel="stylesheet">
<link  href="/crmp/Public/css/mainstyle.css" rel="stylesheet">
<link  href="/crmp/Public/css/showBo.css" rel="stylesheet"/>
<script src="/crmp/Public/js/showBo.js"></script>
<script src="/crmp/Public/js/jquery-1.11.1.min.js"></script>
<script src="/crmp/Public/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function() {
		$('.countc').click(function() {
			folderc();
		});
		$('.counts').click(function() {
			folders();
		});
		//时钟
		$('#date').html(new Date().toLocaleDateString());
		setInterval(function() {
			$('#clock').html(new Date().toLocaleTimeString());
		}, 1000);

		$('.dctsk').click(function() {
			$('#dctsk').css('display', 'none');
		});
	})
	//点文件夹事件
	function folderc() {
		if (!($('#clientdemo').attr('class') == 'collapse')) {
			$('.countc').find('span').removeClass().addClass(
					'glyphicon glyphicon-folder-close');
		} else {
			$('.countc').find('span').removeClass().addClass(
					'glyphicon glyphicon-folder-open');
		}
	}
	function folders() {
		if (!($('#staffdemo').attr('class') == 'collapse')) {
			$('.counts').find('span').removeClass().addClass(
					'glyphicon glyphicon-folder-close');
		} else {
			$('.counts').find('span').removeClass().addClass(
					'glyphicon glyphicon-folder-open');
		}
	}
</script>

</head>
<body>
	<div class="container">
		<header class="navbar navbar-default">
			<nav class="collapse navbar-collapse ">
				<div class="navbar-header">
					<a class="navbar-brand orange" href="<?php echo U('Main/main');?>">企业CRM管理平台V1.0</a>
				</div>
				<ul class="nav navbar-nav navbar-left">
					<li class="gettime">
						<div>
							<span id="date">日期加载中</span>
							<br>
							<i class="fa fa-clock-o"></i>
							<span id="clock">时间加载中</span>
						</div>
					</li>
				</ul>
				<ul class="nav navbar-nav navbar-right">
					<li>
						<a href="<?php echo U('PublicOperate/onlineUser');?>" class="orange"
							data-toggle="dialog" data-id="online" data-mask="true"
							data-width="600" data-height="300">
							在线
							<span class="badge">
								<?php $where['update_time']=array('gt',time()-600);echo M('user')->where($where)->count(); ?>
							</span>
						</a>
					</li>
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							我的账户
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu menu">
							<li>
								<a href="#changePwd" data-toggle="modal">
									<span class="glyphicon glyphicon-lock"></span>
									修改密码
								</a>
							</li>
							<li>
								<a href="#changeUser" data-toggle="modal">
									<span class="glyphicon glyphicon-user"></span>
									我的资料
								</a>
							</li>
							<li class="divider"></li>
							<li>
								<a href="#logout" data-toggle="modal" class="red">
									<span class="glyphicon glyphicon-off"></span>
									注销登陆
								</a>
							</li>
						</ul>
					</li>
				</ul>
			</nav>
		</header>
	</div>
	<div class="container capacity">
		<div class="row">
			<div class="col-xs-3 menu capacity">
				<div class="panel-group" id="aa">
					<div class="panel panel-info">
						<div class="panel-heading">
							<h4>
								<a href="<?php echo U('Main/main');?>">主菜单</a>
							</h4>
						</div>
					</div>
					
					<div class="panel panel-info">
						<div class="panel-heading">
							<button class="btn btn-primary" data-parent="#aa"
								data-toggle="collapse" data-target="#bb">客户管理</button>
						</div>
						<div class="panel-collapse collapse" id="bb">
							<div class="panel-body">
								<div class="list-group">
									<a class="list-group-item btn btn-info" href="<?php echo U('CustInfo/custInfo');?>">
										<span class="glyphicon glyphicon-file"></span>
										客户信息
									</a>
									<a class="list-group-item btn btn-info" href="<?php echo U('CustGd/index');?>">
										<span class="glyphicon glyphicon-file"></span>
										跟单记录
									</a>
									<a class="list-group-item btn btn-info" href="<?php echo U('Hetong/index');?>">
										<span class="glyphicon glyphicon-file"></span>
										合同管理
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										收款记录
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										付款记录
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										开票记录
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										发货记录
									</a>
									<a class="list-group-item btn btn-info countc"
										data-toggle="collapse" data-target="#clientdemo">
										<span class="glyphicon glyphicon-folder-close"></span>
										统计分析
									</a>
									<div id="clientdemo" class="collapse">
										<div class="list-group">
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												客户分析
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												合同增长
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												业务员分析
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												即将到期合同
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												需要跟踪的客户
											</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div class="panel panel-info">
						<div class="panel-heading">
							<button class="btn btn-primary" data-parent="#aa"
								data-toggle="collapse" data-target="#cc">库存管理</button>
						</div>
						<div class="panel-collapse collapse" id="cc">
							<div class="panel-body">
								<div class="list-group">
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										产品信息
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										入库记录
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										出库记录
									</a>
									 <a
										class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										库存管理
									</a> 
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										库存报警
									</a>
								</div>
							</div>
						</div>
					</div>
					
					<div class="panel panel-info">
						<div class="panel-heading">
							<button class="btn btn-primary" data-parent="#aa"
								data-toggle="collapse" data-target="#dd">人事管理</button>
						</div>
						<div class="panel-collapse collapse" id="dd">
							<div class="panel-body">
								<div class="list-group">
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										发布通知
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										员工档案
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										人事合同
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										奖罚管理
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										培训管理
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										人事调动
									</a>
									<a class="list-group-item btn btn-info">
										<span class="glyphicon glyphicon-file"></span>
										员工关怀
									</a>
									<a class="list-group-item btn btn-info counts"
										data-toggle="collapse" data-target="#staffdemo">
										<span class="glyphicon glyphicon-folder-close"></span>
										统计分析
									</a>
									<div id="staffdemo" class="collapse">
										<div class="list-group">
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												下月生日
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												即将到期合同
											</a>
											<a class="list-group-item btn btn-info">
												<span class="glyphicon glyphicon-file"></span>
												员工分析
											</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					
				</div>
			</div>
			<div id="inquiry" class="col-xs-9">
				<!--//-->
				
<div class="panel panel-primary">
	<div class="panel-heading">
		<span class="glyphicon glyphicon-th-list">&nbsp;</span>
		<b>新增合同</b>
		<a href="<?php echo U('Hetong/index');?>">
			<span class="glyphicon glyphicon-remove"
				style="float: right; color: white"></span>
		</a>
	</div>
	<form action="/crmp/admin.php/Hetong/add" method="post">
		<table class="table table-condensed table-hover">
			<tr>
				<td>
					<label for='bianhao_input' class='control-label x85'>合同编号:</label>
					<input type='text' id='bianhao' name='bianhao' size='20'
						value='<?php echo ($Rs["bianhao"]); ?>'>
				<td>
					<label for='dqrq_input' class='control-label x85'>到期日期:</label>
					<input type='text' data-toggle='datepicker' id='dqrq' name='dqrq'
						size='20' value='<?php echo (substr($Rs["dqrq"],0,10)); ?>'>
				</td>
			</tr>
			<tr>
				<td>
					<label for='title_input' class='control-label x85'>合同名称:</label>
					<input type='text' id='title' name='title' data-rule='required;'
						size='20' value='<?php echo ($Rs["title"]); ?>'>
				</td>
				<td>
					<label for='jcid_input' class='control-label x85'>客户ID:</label>
					<input type='text' id='jcid' name='jcid' size='20'
						data-toggle='lookup' value='<?php echo ($Rs["jcid"]); ?>'>
				</td>
			</tr>
			<tr>
				<td>
					<label for='jcname_input' class='control-label x85'>客户名称:</label>
					<input type='text' id='jcname' name='jcname' size='20'
						data-toggle='lookup' value='<?php echo ($Rs["jcname"]); ?>'>
				</td>
				<td>
					<label for='xingming_input' class='control-label x85'>联系人:</label>
					<input type='text' id='xingming' name='xingming' size='20'
						value='<?php echo ($Rs["xingming"]); ?>'>
				</td>
			</tr>
			<tr>
				<td>
					<label for='dianhua_input' class='control-label x85'>联系电话:</label>
					<input type='text' id='dianhua' name='dianhua' size='20'
						value='<?php echo ($Rs["dianhua"]); ?>'>
				</td>
				<td>
					<label for='jine_input' class='control-label x85'>合同金额:</label>
					<input type='text' id='jine' name='jine'
						data-rule='required;doubles' size='20' value='<?php echo ($Rs["jine"]); ?>'>
				</td>
			</tr>
			<tr>
				<td>
					<label for='name_input' class='control-label x85'>业务员:</label>
					<input type='text' id='name' name='name' size='20'
						data-toggle='lookup' value='<?php echo ($Rs["name"]); ?>'>
				</td>
			</tr>
			<tr>
				<td colspan=2>
					<label for='beizhu_input' class='control-label x85'>合同详情:</label>
					<div style='display: inline-block; vertical-align: middle;'>
						<textarea
							style="display:inline-block; height: 100%; vertical-align:middle;"
							name='value' cols='65' rows='5' name='beizhu'><?php echo ($Rs["beizhu"]); ?></textarea>
					</div>
				</td>
			</tr>
		</table>
		<div class="row">
			<button type="submit"
				class="col-md-1 col-md-offset-8 btn btn-sm btn-primary"
				data-icon="save">保存</button>
			<a href="<?php echo U('Hetong/index');?>" type="button"
				class="col-md-1 col-md-offset-1 btn btn-sm btn-default"
				data-icon="close">取消</a>
		</div>
	</form>
	<br />
</div>

				<!--//-->
			</div>
		</div>
	</div>
	<div class="container">
		<footer id="bjui-footer" class="footer">
			<span class="glyphicon glyphicon-map-marker"></span>
			您好！<?php echo (session('depname')); ?> <?php echo (session('posname')); ?>
			<?php echo (session('truename')); ?> (<?php echo (session('username')); ?>)
			您的IP:<?php echo (session('loginip')); ?> 登录时间:<?php echo (session('logintime')); ?>

			<span class="right">
				<a href="">XXXX@科技网络有限公司</a>
				服务热线：000-000-0000
			</span>
		</footer>
	</div>
	<div id="changePwd" class="modal">
		<div class="modal-dialog" style="width: 450px;">
			<div class="modal-content">
				<div class="modal-header">
					<span class="glyphicon glyphicon-th-list">&nbsp;</span>
					修改密码
				</div>
				<form class="form-horizontal" method="post"
					action="<?php echo U('PublicOperate/changePwd');?>">
					<div class="modal-body">
						<div class="form-group">
							<label for="aa" class="control-label col-xs-3">旧&nbsp;&nbsp;密&nbsp;&nbsp;码:</label>
							<div class="col-xs-8">
								<input id="aa" class="form-control" type="password"
									required="required" placeholder="旧密码" name="oldpassword" />
							</div>
						</div>
						<div class="form-group">
							<label for="bb" class="control-label col-xs-3">新&nbsp;&nbsp;密&nbsp;&nbsp;码:</label>
							<div class="col-xs-8">
								<input id="bb" class="form-control" type="password"
									required="required" placeholder="新密码" name="password" />
							</div>
						</div>
						<div class="form-group">
							<label for="bb" class="control-label col-xs-3">确认密码:</label>
							<div class="col-xs-8">
								<input id="bb" class="form-control" type="password"
									required="required" placeholder="确认密码" name="repassword" />
							</div>
						</div>
					</div>
					<div class="modal-footer" style="padding-right: 60px">
						<button class="btn btn-primary" type="submit">修改</button>
						<button class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</form>
			</div>
		</div>
	</div>
	<div id="logout" class="modal">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button class="close" data-dismiss="modal">&times;</button>
					<h3 class="modal-title">
						<span class="glyphicon glyphicon-off"></span>
						确定退出登录
					</h3>
				</div>
				<div class="modal-body">你确定要退出登录吗？</div>
				<div class="modal-footer">
					<a href="<?php echo U('Index/logout');?>" class="btn btn-primary">确定</a>
					<button class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<?php $id = session('uid'); $Rs = M('user')->find($id); ?>
	<div id="changeUser" class="modal">
		<div class="modal-dialog" style="width: 450px;">
			<div class="modal-content">
				<div class="modal-header">
					<span class="glyphicon glyphicon-th-list">&nbsp;</span>
					个人资料
				</div>
				<form class="form-horizontal" method="post"
					action="<?php echo U('PublicOperate/changeUser');?>">
					<div class="modal-body">
						<input type="hidden" name="id" value="<?php echo ($id); ?>" />
						<table class="table table-condensed table-hover" width="100%">
							<tr>
								<td>
									<label for="j_title" class="control-label x85">真实姓名：</label>
									<input type="text" data-rule="required" size="25"
										name="truename" id="j_truename" value="<?php echo ($Rs['truename']); ?>"
										disabled>
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">性别：</label>
									<select name="sex" data-toggle="selectpicker"
										data-rule="required">
										<?php if($Rs['sex'] == '男'): ?><option value="男" selected>男</option>
										<?php else: ?>
										<option value="女" selected>女</option><?php endif; ?>
										<option value="男">男</option>
										<option value="女">女</option>
									</select>
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">固定电话：</label>
									<input type="text" data-rule="required" size="25" name="tel"
										id="j_tel" value="<?php echo ($Rs['tel']); ?>">
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">移动电话：</label>
									<input type="text" data-rule="required" size="25" name="phone"
										id="j_phone" value="<?php echo ($Rs['phone']); ?>">
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">电子邮箱：</label>
									<input type="text" data-rule="required" size="25" name="email"
										id="j_email" value="<?php echo ($Rs['email']); ?>">
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">qq：</label>
									<input type="text" data-rule="required" size="25" name="qq"
										id="j_qq" value="<?php echo ($Rs['qq']); ?>">
								</td>
							</tr>
							<tr>
								<td>
									<label for="j_title" class="control-label x85">内线/短号：</label>
									<input type="text" size="25" name="neixian"
										value="<?php echo ($Rs['neixian']); ?>">
								</td>
							</tr>
						</table>
					</div>
					<div class="modal-footer" style="padding-right: 60px">
						<button class="btn btn-primary" type="submit">保存</button>
						<button class="btn btn-default" data-dismiss="modal">取消</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
</body>
</html>